/**
 *    Copyright 2009-2019 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.apache.ibatis.reflection.invoker;

import java.lang.reflect.InvocationTargetException;

/**
 * mybatis中定义的用于执行方法或者属性反射操作的类
 * <p>
 * 作用是统一基于反射处理方法/属性的调用方式
 *
 * @author Clinton Begin
 */
public interface Invoker {
    /**
     * 执行反射操作
     *
     * @param target 方法或者属性执行的目标对象
     * @param args   方法或者属性执行时依赖的参数
     * @return 方法执行结果
     * @throws IllegalAccessException    无访问权限
     * @throws InvocationTargetException 反射执行异常
     */
    Object invoke(Object target, Object[] args) throws IllegalAccessException, InvocationTargetException;

    /**
     * 方法或者属性对应的类型
     */
    Class<?> getType();
}
